package engine;

/**
 * My own boxing of Java types so I may re-set them during run-time.
 *
 * <p>Generics were not used because primitive types are not supported.</p>
 *
 * @author Ricardo Cruz {@literal <ricardo.pdm.cruz@gmail.com>}
 * @since  2014-11-12
 */
public class Parameter<T extends Number>
{
	private int model;
	private String type;
	private String name;
	private T value;

	public Parameter(int model, String type, String name, T value) {
		this.model = model;
		this.type = type;
		this.name = name;
		this.value = value;
		Parameters.register(this);
	}

	/**
	 * Model of the parameter
	 * @return model. -1 if applicable to all.
	 */
	public int getModel() {
		return model;
	}

	/**
	 * Category of the parameter
	 * @return type
	 */
	public String getType() {
		return type;
	}

	/**
	 * Name of the parameter.
	 * @return the parameter's name
	 */
	public String getName() {
		return name;
	}

	/**
	 * The value as an Object.
	 * @return the value
	 */
	public T get() {
		return value;
	}

	/**
	 * Specifies another value for the parameter.
	 * @param value
	 */
	public void set(T value) {
		this.value = value;
	}
}
